package org.example.chat.validate.annotation;

import org.example.chat.validate.validator.XssValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * 校验文本之中是否含有xss攻击脚本
 * @author cheva
 */
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = XssValidator.class)
public @interface XSS {
    String message() default "非法输入，检测到存在潜在的XSS攻击脚本";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}
